<?php
// 时区设置
date_default_timezone_set('Asia/Shanghai');
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// 定义类库路径常量
defined('LIBRARY_PATH')
|| define('LIBRARY_PATH', realpath(APPLICATION_PATH . '/../library'));

// 定义类库路径常量
defined('CRONJOB_PATH')
|| define('CRONJOB_PATH', realpath(APPLICATION_PATH . '/../cron'));

defined('PUBLIC_PATH')
|| define('PUBLIC_PATH', realpath(dirname(__FILE__) . '/'));

defined('PUBLIC_UPLOAD_PATH')
|| define('PUBLIC_UPLOAD_PATH', realpath(dirname(__FILE__) . '/upload/'));

// Define application environment
define('APPLICATION_ENV', 'development');
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
	realpath(APPLICATION_PATH . '/base'),
	realpath(APPLICATION_PATH . '/../library'),
	get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
	APPLICATION_ENV,
	APPLICATION_PATH . "/configs/" . APPLICATION_ENV . '/application.ini'
);

$application->bootstrap();